def add_two_numbers(a, b):  # 函数(形参)
    return a + b


print(add_two_numbers(10, 20))  # 实参


def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True


print(is_prime(23))


def test(*args):  # 打包*
    print(args)


test(1, 2, 3)


def test2(**kwargs):  # 打包**
    print(kwargs)


test2(a=11, b=22, c=33, d=44)


def test(**kwargs):  # **收集字典
    print(kwargs)


test(time='晚上', place='操场', activity='团建')


def test(*args):  # *收集元组
    print(args)


test('晚上', '操场', '团建', '班导', '星空', '草地', '路灯', '快速路', '飞机')

list1 = [1, 2, 3]
print(*list1)  # 解包


# 递归实现阶乘
def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n - 1)


print(factorial(5))